package com.bharatonjava.hospital.dao.rowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import com.bharatonjava.hospital.domain.Patient;

public class PatientRowMapper implements RowMapper<Patient>{

	@Override
	public Patient mapRow(ResultSet rs, int rownum) throws SQLException {
		Patient p = new Patient();
		p.setPatientId(rs.getLong("patient_id"));
		p.setAddressId(rs.getLong("address_id"));
		p.setFirstName(rs.getString("patient_first_name"));
		p.setMiddleName(rs.getString("patient_middle_name"));
		p.setLastName(rs.getString("patient_last_name"));
		p.setGender(rs.getString("patient_gender"));
		p.setDob(rs.getString("patient_dob"));
		return p;
	}

}
